package string;

import java.util.Arrays;

public class StringSplit {

    public static void main(String[] args) {
        String str="hello world hi java";
        //1、将字符串全部拆分
        String[] data1=str.split(" ");
        System.out.println(Arrays.toString(data1));
        //2、将字符串全部拆分，拆分后的字符数组长度为limit
        String[] data2=str.split(" ",3);
        System.out.println(Arrays.toString(data2));
    }
}
